package thread;

public class SleepDemo2 {
    public static void main(String[] args) {
        Thread cjc = new Thread("cjc"){
            public void run(){
                try {
                    System.out.println(getName()+"睡了");
                    Thread.sleep(10000000);
                } catch (InterruptedException e) {
                    System.out.println("damn!");
                }
                System.out.println(getName()+"醒了");
            }
        };
        Thread xiaoming = new Thread("小明"){
            public void run(){
                System.out.println(getName()+"中午去哪吃饭");
                try {
                    Thread.sleep(3000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println(getName()+"去问问cjc");
                cjc.interrupt();
            }
        };
        cjc.start();
        xiaoming.start();




    }
}
